Skip to content

feat: add config toggle to disable transition notifications#580

Open
johnuopini wants to merge 10 commits intoasheshgoplani:mainfrom
johnuopini:feat/transition-notify-toggle
Open

feat: add config toggle to disable transition notifications#580
johnuopini wants to merge 10 commits intoasheshgoplani:mainfrom
johnuopini:feat/transition-notify-toggle

Conversation

@johnuopini
Copy link
Copy Markdown
Contributor

@johnuopini johnuopini commented Apr 12, 2026

Summary

Add global and per-session controls to suppress transition event notifications
(tmux messages sent to parent sessions when a child changes status).

  • New transition_events toggle in [notifications] config (default: true)
  • New NoTransitionNotify field on Instance for per-session suppression
  • --no-transition-notify flag on add and launch commands
  • session set-transition-notify <id> <on|off> subcommand for runtime control
  • Guards in both syncProfile() and emitHookTransitionCandidates() daemon paths
  • Guard in dispatch() itself to cover deferred/retried events that bypass daemon guards
  • Full SQLite persistence with schema v6 migration

Parent linking is unaffected — only dispatch is suppressed.

Usage

Global (config.toml):

[notifications]
transition_events = false

Per-session (at creation):

agent-deck add --no-transition-notify -c claude .

Per-session (runtime toggle):

agent-deck session set-transition-notify worker off
agent-deck session set-transition-notify worker on

Test plan

  • go vet ./... passes
  • go build ./... passes
  • New unit tests pass: config default/explicit, JSON round-trip, daemon guard
  • Manual: create parent + child sessions, verify --no-transition-notify suppresses tmux messages
  • Manual: toggle with session set-transition-notify worker off/on, verify behavior changes
  • Manual: set transition_events = false in config.toml, verify global suppression
  • Manual: verified deferred events also suppressed (dispatch-level guard)

@johnuopini johnuopini force-pushed the feat/transition-notify-toggle branch from 8ce2ba0 to 176c887 Compare April 13, 2026 06:17
Add TransitionEvents *bool field to NotificationsConfig with a getter
that defaults to true. This allows users to globally suppress transition
event dispatch (tmux send-keys to parent sessions) via:

  [notifications]
  transition_events = false
Per-session flag to suppress transition event dispatch. When true,
the transition daemon skips sending tmux messages to the parent
for this session's status changes. Serialized as
no_transition_notify with omitempty.
Check GetTransitionEventsEnabled() and Instance.NoTransitionNotify
in both syncProfile() and emitHookTransitionCandidates() before
calling NotifyTransition(). When either is suppressed, the event
is silently skipped (no dispatch, no logging).
Mirrors the --no-parent pattern. Sets NoTransitionNotify on the
new instance so the transition daemon skips dispatch for it.
Same as the add command flag — sets NoTransitionNotify on the instance.
Toggle transition event dispatch per-session:
  agent-deck session set-transition-notify <id> <on|off>

When off, the daemon skips sending tmux messages to the parent
for this session's status transitions. The parent link is unchanged.
Display the flag in both JSON and human-readable output.
Only shown in human-readable when the flag is true.
The field was only set in memory but lost on save/load because it was
missing from the statedb InstanceRow, SQL schema, and the three
mapping layers (Instance→InstanceRow, InstanceRow→InstanceData,
InstanceData→Instance).

Add no_transition_notify column (schema v5 with migration), wire it
through SaveInstance, SaveInstances, LoadInstances, and all storage
mapping sites.
@johnuopini johnuopini force-pushed the feat/transition-notify-toggle branch from 176c887 to 15744da Compare April 14, 2026 09:27
The daemon guards (syncProfile, emitHookTransitionCandidates) correctly
skipped calling NotifyTransition() when the flag was set, but dispatch()
itself never checked it. Deferred/retried events bypass the daemon guards
and call dispatch() directly, so sessions with no_transition_notify=true
still received events.

Drop the event in dispatch() right after the child instance is resolved,
before any parent lookup or delivery attempt.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant